package com.qf.blog.utils;

import lombok.Data;

@Data
public class Result {
    private Integer code;

    private String msg;

    private Object data;

    public static Result success(){
        Result success = new Result();
        success.setCode(0);
        return success;
    }

    public static Result success(Object data){
        Result success = success();
        success.setData(data);
        return success;
    }

    public static Result error(String msg){
        Result error = new Result();
        error.setCode(1);
        error.setMsg(msg);
        return error;
    }
}
